package com.chen.wxchat.entity;


import com.chen.wxchat.tools.HtmlTool;

import java.util.List;

public class Article {
    private String articleId;
    private String articleTitle;
    private String articleContent;
    private String articleCreateTime;
    private String simpleContent;
    private int readCount;
    private int replyCount;
    private UserInfo userInfo;
    private List<Reply> reply;
    private String userId;
    private String state;

    public String getArticleId() {
        return articleId;
    }

    public void setArticleId(String articleId) {
        this.articleId = articleId;
    }

    public String getArticleTitle() {
        return articleTitle;
    }

    public void setArticleTitle(String articleTitle) {
        this.articleTitle = articleTitle;
    }

    public String getArticleContent() {
        return articleContent;
    }

    public void setArticleContent(String articleContent) {
        this.articleContent = articleContent;
    }

    public String getArticleCreateTime() {
        return articleCreateTime;
    }

    public void setArticleCreateTime(String articleCreateTime) {
        this.articleCreateTime = articleCreateTime;
    }

    public int getReadCount() {
        return readCount;
    }

    public void setReadCount(int readCount) {
        this.readCount = readCount;
    }

    public UserInfo getUserInfo() {
        return userInfo;
    }

    public void setUserInfo(UserInfo userInfo) {
        this.userInfo = userInfo;
    }

    public List<Reply> getReply() {
        return reply;
    }

    public void setReply(List<Reply> reply) {
        this.reply = reply;
    }

    public int getReplyCount() {
        return getReply().size();
    }

    public void setReplyCount(int replyCount) {
        this.replyCount = getReply().size();
    }

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public String getState() {
        return state;
    }

    public void setState(String state) {
        this.state = state;
    }

    public String getSimpleContent() {
        return HtmlTool.Html2Text(getArticleContent());
    }

    public void setSimpleContent(String simpleContent) {
        this.simpleContent = simpleContent;
    }
}
